<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ page import="com.CGFrame.struts.bean.message.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>选择用户</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<LINK href="styles/stylewang.css"  type=text/css rel=stylesheet>
	<LINK href="./styles/sciencee.css"  type=text/css rel=stylesheet>
	<script type="text/javascript" src="js/all.js"></script>
	<script language=javascript>
		function initMiddle(){
			var as=document.getElementsByTagName("a");
			if(navigator.appName=="Microsoft Internet Explorer"){
				var ieShowEmp=function(id){
					return function(){
						showEmp(id);
					}
				}
				for(var i=0;i<as.length;i++){
					var id=as[i].parentNode.getAttribute("id");
					as[i].attachEvent("onclick",ieShowEmp(id)); 
				}
			}else{
				for(var i=0;i<as.length;i++){
					var id=as[i].parentNode.getAttribute("id");
					as[i].setAttribute("onclick","showEmp("+id+");");
				}
			}
			window.users.location.href="<%=path%>/message/userInProject.do?projectId=<%=session.getAttribute("ProjectID")%>";
		}
		function submitUsers(){
			var a=document.getElementById("selectedusers");
			var b=opener.document.getElementById("<%=request.getParameter("opener")%>");
			b.value=a.value;
			window.close();
		}
		function showEmp(id){
			window.users.location.href="<%=path%>/message/userInProject.do?sectorId="+id;
		}
	</script>
  </head>
  
  <body onLoad="initMiddle();"><div id="bgwin">
  <table height="100%" width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
  	<td width="30%" align="left" valign="top"><div>
<%
   TreeViewElement[] top =  TreeviewRender.getTopCategory();
   for(int i= 0;i<top.length;i++)
     out.println(TreeviewRender.renderStatic(top[i],true));
%>
		</div>
	</td>
	<td width="30%" valign="top" >
		<div><bean:message key="message.selectuser"/>(<bean:message key="defaultuser"/>)</div>
		<iframe id="users" name="users" width="98%" frameborder="0" class="bgswin"></iframe>
	</td>
	<td width="30%" valign="top">
		<div><bean:message key="selected"/></div>
		<textarea id="selectedusers" name="selectedusers" ></textarea>
		<input type="button" value="<bean:message key='submit'/>" onClick="submitUsers();">
	</td>
	</tr>
	</table></div>
  </body>
</html>
